﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!-- Buttons default style -->
    <Style TargetType="{x:Type Button}">
        <Setter Property="Foreground">
            <Setter.Value>#FF959494</Setter.Value>
        </Setter>
        <Setter Property="FontSize">
            <Setter.Value>14</Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle Stroke="{x:Null}" RadiusX="6.7" RadiusY="6.7">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.509,0.974" StartPoint="0.509,0.04">
                                    <GradientStop Color="#FF000000" Offset="0"/>
                                    <GradientStop Color="#FF313131" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Stroke="{x:Null}" RadiusX="6.7" RadiusY="6.7" x:Name="rectangle">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.509,0.974" StartPoint="0.509,0.04">
                                    <GradientStop Color="#4B474747" Offset="0"/>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="rectangle">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-0.185">
                                        <GradientStop Color="#FF783333" Offset="1"/>
                                        <GradientStop Color="#FF0C0404" Offset="0"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Close button template -->
    <Style TargetType="{x:Type Button}" x:Key="CloseButton">
        <Setter Property="Foreground">
            <Setter.Value>#FF959494</Setter.Value>
        </Setter>
        <Setter Property="FontSize">
            <Setter.Value>14</Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Rectangle Stroke="{x:Null}" RadiusX="6.7" RadiusY="6.7">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.509,0.974" StartPoint="0.509,0.04">
                                    <GradientStop Color="#FF000000" Offset="0"/>
                                    <GradientStop Color="#FF313131" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Stroke="{x:Null}" RadiusX="6.7" RadiusY="6.7" x:Name="rectangle">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.509,0.974" StartPoint="0.509,0.04">
                                    <GradientStop Color="#4B474747" Offset="0"/>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Image Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Image.Style>
                                <Style TargetType="{x:Type Image}">
                                    <Setter Property="Source" Value="\Images\en-us\CloseWindowInActive.png"/>
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Source" Value="\Images\en-us\CloseWindowActive.png"/>
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>
                        <!--</ContentPresenter>-->
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True"/>
                        <Trigger Property="IsDefaulted" Value="True"/>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" TargetName="rectangle">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-0.185">
                                        <GradientStop Color="#FF783333" Offset="1"/>
                                        <GradientStop Color="#FF0C0404" Offset="0"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>